# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 101
n 101(None)[return None
]:
	i: 38(), 78()
	o: 

nname: 78
n 78(None)[louie_send('on_user_idle', self)
self._idle_timer = None
]:
	i: 0&15(f)
	o: 101()

nname: 38
n 38(None)[self._idle_timer.stop()
self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
]:
	i: 0&15(t)
	o: 101()

nname: 0&15
n 0&15(actual_speed and int(actual_speed * 10) != 10)[actual_speed = self.speed
]:
	i: 
	o: 38(t), 78(f)

nname: 0&15
n 0&15(None)[actual_speed = self.speed
if actual_speed and int(actual_speed * 10) != 10:
	self._idle_timer.stop()
	self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
else:
	louie_send('on_user_idle', self)
	self._idle_timer = None
return None
]:
	i: 
	o: 

self.nodes: {'0&15': <unpyclib.structure.node instance at 0xb76b4d6c>}
nname: 79
n 79(None)[self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
return None
]:
	i: 33(), 65()
	o: 

nname: 65
n 65(None)[self._idle_timer.stop()
]:
	i: 18(f)
	o: 79()

nname: 33
n 33(None)[self._idle_timer = Task(_on_idle)
louie_send('on_user_event', self)
]:
	i: 18(t)
	o: 79()

nname: 18
n 18(self._idle_timer is None)[]:
	i: 9(), 17()
	o: 33(t), 65(f)

nname: 17
n 17(None)[]:
	i: 0(f)
	o: 18()

nname: 9
n 9(None)[return None
]:
	i: 0(t)
	o: 18()

nname: 0
n 0(self.is_menu)[]:
	i: 
	o: 9(t), 17(f)

nname: 79
n 79(None)[self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if self.is_menu:
	return None
if self._idle_timer is None:
	self._idle_timer = Task(_on_idle)
	louie_send('on_user_event', self)
else:
	self._idle_timer.stop()
]:
	i: 
	o: 79()

nname: 0
n 0(None)[if self.is_menu:
	return None
if self._idle_timer is None:
	self._idle_timer = Task(_on_idle)
	louie_send('on_user_event', self)
else:
	self._idle_timer.stop()
self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76b4d6c>}
nname: 72
n 72(None)[return ret
]:
	i: 60(), 71()
	o: 

nname: 71
n 71(None)[]:
	i: 0(f)
	o: 72()

nname: 60
n 60(None)[_on_action()
]:
	i: 0(t)
	o: 72()

nname: 0
n 0(self.is_playing)[def _on_idle():
	actual_speed = self.speed
	if actual_speed and int(actual_speed * 10) != 10:
		self._idle_timer.stop()
		self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
	else:
		louie_send('on_user_idle', self)
		self._idle_timer = None
	return None

def _on_action():
	if self.is_menu:
		return None
	if self._idle_timer is None:
		self._idle_timer = Task(_on_idle)
		louie_send('on_user_event', self)
	else:
		self._idle_timer.stop()
	self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
	return None

ret = func(self, *args, **kw)
]:
	i: 
	o: 60(t), 71(f)

nname: 0
n 0(None)[def _on_idle():
	actual_speed = self.speed
	if actual_speed and int(actual_speed * 10) != 10:
		self._idle_timer.stop()
		self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
	else:
		louie_send('on_user_idle', self)
		self._idle_timer = None
	return None

def _on_action():
	if self.is_menu:
		return None
	if self._idle_timer is None:
		self._idle_timer = Task(_on_idle)
		louie_send('on_user_event', self)
	else:
		self._idle_timer.stop()
	self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
	return None

ret = func(self, *args, **kw)
if self.is_playing:
	_on_action()
return ret
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76b3dcc>}
nname: 0
n 0(None)[def exe(self, *args, **args):
	def _on_idle():
		actual_speed = self.speed
		if actual_speed and int(actual_speed * 10) != 10:
			self._idle_timer.stop()
			self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
		else:
			louie_send('on_user_idle', self)
			self._idle_timer = None
		return None

	def _on_action():
		if self.is_menu:
			return None
		if self._idle_timer is None:
			self._idle_timer = Task(_on_idle)
			louie_send('on_user_event', self)
		else:
			self._idle_timer.stop()
		self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
		return None

	ret = func(self, *args, **kw)
	if self.is_playing:
		_on_action()
	return ret

return exe
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76b334c>}
nname: 0
n 0(None)[self._wydvd = Wydvd()
self._player = player
WydvdCatcher.actions_dict['WYDVD_UOP_PROHIBITED'] = player._activate_uop_display
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76b3dac>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c23cc>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c24cc>}
nname: 72
n 72(None)[]:
	i: 3(), 30(), 70(AE)
	o: 

nname: 70
n 70(None)[]:
	i: 20(f)
	o: 72(AE)

nname: 30
n 30(None)[#, e
WydvdCatcher.actions_dict.get(str(e), (lambda : None))()
]:
	i: 20(t)
	o: 72()

nname: 20
n 20(<dummy_ex3> EXC_MATCH WydvdException)[]:
	i: 0(except)
	o: 30(t), 70(f)

nname: 3
n 3(None)[return res(*args, **kw)
]:
	i: 0(try)
	o: 72()

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 20(except)

nname: 20
n 20(None)[except WydvdException, e:
	WydvdCatcher.actions_dict.get(str(e), (lambda : None))()
]:
	i: 0()
	o: 

nname: 0
n 0(None)[try:
	return res(*args, **kw)
]:
	i: 
	o: 20()

nname: 0
n 0(None)[try:
	return res(*args, **kw)
except WydvdException, e:
	WydvdCatcher.actions_dict.get(str(e), (lambda : None))()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76be96c>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76b4ecc>}
nname: 97
n 97(None)[def _fun(*args, **args):
	try:
		return res(*args, **kw)
	except WydvdException, e:
		WydvdCatcher.actions_dict.get(str(e), (lambda : None))()

return _fun
]:
	i: 63(), 77(), 95(AE)
	o: 

nname: 95
n 95(None)[]:
	i: 67(f)
	o: 97(AE)

nname: 77
n 77(None)[#, e
def res(*args, **args):
	return None

]:
	i: 67(t)
	o: 97()

nname: 67
n 67(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 0(except)
	o: 77(t), 95(f)

nname: 63
n 63(None)[]:
	i: 54(), 62()
	o: 97()

nname: 62
n 62(None)[]:
	i: 9(t)
	o: 63()

nname: 54
n 54(None)[return res
]:
	i: 9(f)
	o: 63()

nname: 9
n 9(isinstance(res, (types.MethodType, types.FunctionType)))[res = getattr(self._wydvd, name)
]:
	i: 0(try)
	o: 54(f), 62(t)

nname: 0
n 0(None)[res = None
]:
	i: 
	o: 9(try), 67(except)

nname: 97
n 97(None)[def _fun(*args, **args):
	try:
		return res(*args, **kw)
	except WydvdException, e:
		WydvdCatcher.actions_dict.get(str(e), (lambda : None))()

return _fun
]:
	i: 67(), 0()
	o: 

nname: 67
n 67(None)[except AttributeError, e:
	def res(*args, **args):
		return None

]:
	i: 0()
	o: 97()

nname: 97
n 97(None)[def _fun(*args, **args):
	try:
		return res(*args, **kw)
	except WydvdException, e:
		WydvdCatcher.actions_dict.get(str(e), (lambda : None))()

return _fun
]:
	i: 67(), 0()
	o: 

nname: 0
n 0(None)[res = None
try:
	res = getattr(self._wydvd, name)
	if not isinstance(res, (types.MethodType, types.FunctionType)):
		return res
]:
	i: 
	o: 97(), 67()

self.nodes: {0: <unpyclib.structure.node instance at 0xb76b47ac>, 97: <unpyclib.structure.node instance at 0xb76b444c>, 67: <unpyclib.structure.node instance at 0xb76b4d4c>}
nname: 6
n 6(None)[actions_dict = dict()
def __init__(self, player, *args, **args):
	self._wydvd = Wydvd()
	self._player = player
	WydvdCatcher.actions_dict['WYDVD_UOP_PROHIBITED'] = player._activate_uop_display

def __getattr__(self, name):
	res = None
	try:
		res = getattr(self._wydvd, name)
		if not isinstance(res, (types.MethodType, types.FunctionType)):
			return res

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76b3c6c>}
nname: 0
n 0(None)[self.eventhandler = DVDEventHandler(self)
Player.__init__(self, type)
self.wydvd = WydvdCatcher(self)
self._in_pause = False
self._uop_hide_task = Task(louie_send, 'on_uop_hide', self)
self._uop_hide_task.delay = 3
self.nb_ptt = 0
self._getitems_keywords['speed'] = self._formatted_speed
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76be08c>}
nname: 72
n 72(None)[return '%dx' % s
]:
	i: 63(), 71()
	o: 

nname: 71
n 71(None)[]:
	i: 51(f)
	o: 72()

nname: 63
n 63(None)[return ''
]:
	i: 51(t)
	o: 72()

nname: 51
n 51(s in (0, 1))[]:
	i: 38(), 50()
	o: 63(t), 71(f)

nname: 50
n 50(None)[]:
	i: 35(f)
	o: 51()

nname: 38
n 38(None)[return '%.1fx' % s
]:
	i: 35(t)
	o: 51()

nname: 35
n 35(0 < s)[]:
	i: 23(), 33()
	o: 38(t), 50(f)

nname: 33
n 33(None)[s
]:
	i: 0(f)
	o: 35()

nname: 23
n 23(None)[]:
	i: 0(t)
	o: 35()

nname: 0
n 0(0 < s)[s = self.speed
]:
	i: 
	o: 23(t), 33(f)

nname: 51
n 51(None)[if s in (0, 1):
	return ''
return '%dx' % s
]:
	i: 0()
	o: 

nname: 0
n 0(None)[s = self.speed
if 0 < s:
	pass
else:
	s
if 0 < s:
	return '%.1fx' % s
]:
	i: 
	o: 51()

nname: 0
n 0(None)[s = self.speed
if 0 < s:
	pass
else:
	s
if 0 < s:
	return '%.1fx' % s
if s in (0, 1):
	return ''
return '%dx' % s
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bed0c>}
nname: 0
n 0(None)[return self.wydvd.domain == 'TITLE'
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76be76c>}
nname: 0
n 0(None)[return self.wydvd.domain == 'TITLE'
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76be9cc>}
nname: 30
n 30(None)[self._uop_hide_task.start()
]:
	i: 12(), 29()
	o: 

nname: 29
n 29(None)[]:
	i: 0(t)
	o: 30()

nname: 12
n 12(None)[louie_send('on_uop_show', self)
]:
	i: 0(f)
	o: 30()

nname: 0
n 0(self._uop_hide_task.running)[]:
	i: 
	o: 12(f), 29(t)

nname: 0
n 0(None)[if not self._uop_hide_task.running:
	louie_send('on_uop_show', self)
self._uop_hide_task.start()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bebec>}
nname: 257
n 257(None)[return None
]:
	i: 222(), 236(), 255(AE)
	o: 

nname: 255
n 255(None)[]:
	i: 226(f)
	o: 257(AE)

nname: 236
n 236(None)[#, e
PRINT_EXCEPTION(e)
]:
	i: 226(t)
	o: 257()

nname: 226
n 226(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 72(except)
	o: 236(t), 255(f)

nname: 222
n 222(None)[]:
	i: 75(AL), 221()
	o: 257()

nname: 221
n 221(None)[]:
	i: 182(AF), 189()
	o: 222()

nname: 189
n 189(None)[for it in ('progressbar', 'time_remaining', 'time_elapsed', 'time_total', 'status_icon', 'speed'):
louie_send(it, sender=self, value=self[it])
]:
	i: 182(for)
	o: 221()

nname: 182
n 182(None)[]:
	i: 75(loop)
	o: 189(for), 221(AF)

nname: 75
n 75(None)[cur_pos = self.wydvd.get_title_location()
cur_length = self.wydvd.get_title_duration()
self.time_elapsed = cur_pos['hours'] * 3600 + cur_pos['minutes'] * 60 + cur_pos['seconds']
self.total_time = cur_length['hours'] * 3600 + cur_length['minutes'] * 60 + cur_length['seconds']
]:
	i: 72(try)
	o: 182(loop), 222(AL)

nname: 72
n 72(None)[]:
	i: 63(), 71()
	o: 75(try), 226(except)

nname: 71
n 71(None)[]:
	i: 54(t)
	o: 72()

nname: 63
n 63(None)[return None
]:
	i: 54(f)
	o: 72()

nname: 54
n 54(self._idle_timer)[]:
	i: 43(), 47(), 53(AE)
	o: 63(f), 71(t)

nname: 47
n 47(None)[]:
	i: 0(except)
	o: 54()

nname: 43
n 43(None)[]:
	i: 29(), 42()
	o: 54()

nname: 42
n 42(None)[]:
	i: 3(f)
	o: 43()

nname: 29
n 29(None)[self._last_action = None
]:
	i: 3(t)
	o: 43()

nname: 3
n 3(self._last_action['time'] + 1 < sched.ts)[]:
	i: 0(try)
	o: 29(t), 42(f)

nname: 0
n 0(None)[]:
	i: 
	o: 3(try), 47(except)

nname: 257
n 257(None)[return None
]:
	i: 221(), 226()
	o: 

nname: 226
n 226(None)[except Exception, e:
	PRINT_EXCEPTION(e)
]:
	i: 75()
	o: 257()

nname: 221
n 221(None)[]:
	i: 182()
	o: 257()

nname: 182
n 182(None)[for it in ('progressbar', 'time_remaining', 'time_elapsed', 'time_total', 'status_icon', 'speed'):
	louie_send(it, sender=self, value=self[it])
]:
	i: 75(loop)
	o: 221()

nname: 75
n 75(None)[try:
	cur_pos = self.wydvd.get_title_location()
	cur_length = self.wydvd.get_title_duration()
	self.time_elapsed = cur_pos['hours'] * 3600 + cur_pos['minutes'] * 60 + cur_pos['seconds']
	self.total_time = cur_length['hours'] * 3600 + cur_length['minutes'] * 60 + cur_length['seconds']
]:
	i: 54(try)
	o: 182(loop), 226()

nname: 54
n 54(None)[if not self._idle_timer:
	return None
]:
	i: 47(), 0()
	o: 75(try)

nname: 47
n 47(None)[except:
	pass
]:
	i: 0()
	o: 54()

nname: 54
n 54(None)[if not self._idle_timer:
	return None
]:
	i: 47(), 0()
	o: 75(try)

nname: 0
n 0(None)[try:
	if self._last_action['time'] + 1 < sched.ts:
		self._last_action = None
]:
	i: 
	o: 54(), 47()

nname: 257
n 257(None)[return None
]:
	i: 182(), 226()
	o: 

nname: 226
n 226(None)[except Exception, e:
	PRINT_EXCEPTION(e)
]:
	i: 54()
	o: 257()

nname: 182
n 182(None)[for it in ('progressbar', 'time_remaining', 'time_elapsed', 'time_total', 'status_icon', 'speed'):
	louie_send(it, sender=self, value=self[it])
]:
	i: 54(loop)
	o: 257()

nname: 54
n 54(None)[if not self._idle_timer:
	return None
try:
	cur_pos = self.wydvd.get_title_location()
	cur_length = self.wydvd.get_title_duration()
	self.time_elapsed = cur_pos['hours'] * 3600 + cur_pos['minutes'] * 60 + cur_pos['seconds']
	self.total_time = cur_length['hours'] * 3600 + cur_length['minutes'] * 60 + cur_length['seconds']
]:
	i: 47(), 0()
	o: 182(loop), 226()

nname: 47
n 47(None)[except:
	pass
]:
	i: 0()
	o: 54()

nname: 54
n 54(None)[if not self._idle_timer:
	return None
try:
	cur_pos = self.wydvd.get_title_location()
	cur_length = self.wydvd.get_title_duration()
	self.time_elapsed = cur_pos['hours'] * 3600 + cur_pos['minutes'] * 60 + cur_pos['seconds']
	self.total_time = cur_length['hours'] * 3600 + cur_length['minutes'] * 60 + cur_length['seconds']
]:
	i: 47(), 0()
	o: 182(loop), 226()

nname: 0
n 0(None)[try:
	if self._last_action['time'] + 1 < sched.ts:
		self._last_action = None
]:
	i: 
	o: 54(), 47()

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c2d0c>, 257: <unpyclib.structure.node instance at 0xb76c2b8c>, 226: <unpyclib.structure.node instance at 0xb76c292c>, 182: <unpyclib.structure.node instance at 0xb76c290c>, 47: <unpyclib.structure.node instance at 0xb76c272c>, 54: <unpyclib.structure.node instance at 0xb76c28ec>}
nname: 40
n 40(None)[]:
	i: 9(), 29()
	o: 

nname: 29
n 29(None)[self.toggle_pause()
]:
	i: 0(f)
	o: 40()

nname: 9
n 9(None)[self.wydvd.action_button('activate')
]:
	i: 0(t)
	o: 40()

nname: 0
n 0(self.is_menu)[]:
	i: 
	o: 9(t), 29(f)

nname: 0
n 0(None)[if self.is_menu:
	self.wydvd.action_button('activate')
else:
	self.toggle_pause()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bef6c>}
nname: 196
n 196(None)[self._in_pause = False
return None
]:
	i: 143(), 182()
	o: 

nname: 182
n 182(None)[self.wydvd.play()
]:
	i: 110(f)
	o: 196()

nname: 143
n 143(None)[delay['title'] = delay.pop('num')
self.wydvd.time_play(**delay)
]:
	i: 110(t)
	o: 196()

nname: 110
n 110(delay)[self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
]:
	i: 52(), 92(), 109()
	o: 143(t), 182(f)

nname: 109
n 109(None)[]:
	i: 79(f)
	o: 110()

nname: 92
n 92(None)[self.wydvd.open()
]:
	i: 79(t)
	o: 110()

nname: 79
n 79(_t == DVDItem)[]:
	i: 0(f)
	o: 92(t), 109(f)

nname: 52
n 52(None)[self.wydvd.open(path=item['uri'])
]:
	i: 0(t)
	o: 110()

nname: 0
n 0(_t == IsoDVDItem)[Player.play(self, item, playlist)
self._idle_timer = None
_t = type(item)
]:
	i: 
	o: 52(t), 79(f)

nname: 196
n 196(None)[self._in_pause = False
return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[Player.play(self, item, playlist)
self._idle_timer = None
_t = type(item)
if _t == IsoDVDItem:
	self.wydvd.open(path=item['uri'])
else:
	if _t == DVDItem:
		self.wydvd.open()
self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
if delay:
	delay['title'] = delay.pop('num')
	self.wydvd.time_play(**delay)
else:
	self.wydvd.play()
]:
	i: 
	o: 196()

nname: 0
n 0(None)[Player.play(self, item, playlist)
self._idle_timer = None
_t = type(item)
if _t == IsoDVDItem:
	self.wydvd.open(path=item['uri'])
else:
	if _t == DVDItem:
		self.wydvd.open()
self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
if delay:
	delay['title'] = delay.pop('num')
	self.wydvd.time_play(**delay)
else:
	self.wydvd.play()
self._in_pause = False
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c2aec>}
nname: 86
n 86(None)[self.wydvd.stop()
self.wydvd.close()
Player.stop(self)
return None
]:
	i: 28(), 66()
	o: 

nname: 66
n 66(None)[self.selected.vfs_set_metas(playbackStatus='')
]:
	i: 0&18(f)
	o: 86()

nname: 28
n 28(None)[self.selected.vfs_set_metas(playbackStatus=repr(self.wydvd.get_title_location()))
]:
	i: 0&18(t)
	o: 86()

nname: 0&18
n 0&18(self.is_playing and config.resume_dvd)[self._idle_timer = None
]:
	i: 
	o: 28(t), 66(f)

nname: 0&18
n 0&18(None)[self._idle_timer = None
if self.is_playing and config.resume_dvd:
	self.selected.vfs_set_metas(playbackStatus=repr(self.wydvd.get_title_location()))
else:
	self.selected.vfs_set_metas(playbackStatus='')
self.wydvd.stop()
self.wydvd.close()
Player.stop(self)
return None
]:
	i: 
	o: 

self.nodes: {'0&18': <unpyclib.structure.node instance at 0xb76be20c>}
nname: 30
n 30(None)[return 0
]:
	i: 0&10(t), 26()
	o: 

nname: 26
n 26(None)[]:
	i: 0&10(f)
	o: 30()

nname: 0&10
n 0&10(not self._in_pause and self.wydvd.get_speed())[]:
	i: 
	o: 26(f), 30(t)

nname: 0&10
n 0&10(None)[if not(not self._in_pause and self.wydvd.get_speed()):
	pass
return 0
]:
	i: 
	o: 

self.nodes: {'0&10': <unpyclib.structure.node instance at 0xb76be68c>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76beeac>}
nname: 0
n 0(None)[return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76be16c>}
nname: 81
n 81(None)[return None
]:
	i: 22(), 61()
	o: 

nname: 61
n 61(None)[user_action((lambda self: None))(self)
]:
	i: 0&9(f)
	o: 81()

nname: 22
n 22(None)[self._idle_timer.stop()
self._idle_timer = None
louie_send('on_user_idle', self)
]:
	i: 0&9(t)
	o: 81()

nname: 0&9
n 0&9(self._idle_timer and self._idle_timer.running)[]:
	i: 
	o: 22(t), 61(f)

nname: 0&9
n 0&9(None)[if self._idle_timer and self._idle_timer.running:
	self._idle_timer.stop()
	self._idle_timer = None
	louie_send('on_user_idle', self)
else:
	user_action((lambda self: None))(self)
return None
]:
	i: 
	o: 

self.nodes: {'0&9': <unpyclib.structure.node instance at 0xb76be88c>}
nname: 287
n 287(None)[return 'stop'
]:
	i: 259(), 286()
	o: 

nname: 286
n 286(None)[]:
	i: 247(f)
	o: 287()

nname: 259
n 259(None)[return backward_tricks_icons[self.eventhandler.backward_steps.index(speed)]
]:
	i: 247(t)
	o: 287()

nname: 247
n 247(speed < -1)[]:
	i: 219(), 246()
	o: 259(t), 286(f)

nname: 246
n 246(None)[]:
	i: 207(f)
	o: 247()

nname: 219
n 219(None)[return forward_tricks_icons[self.eventhandler.forward_steps.index(speed)]
]:
	i: 207(t)
	o: 247()

nname: 207
n 207(speed > 1)[]:
	i: 198(), 206()
	o: 219(t), 246(f)

nname: 206
n 206(None)[]:
	i: 195(f)
	o: 207()

nname: 198
n 198(None)[return 'slow_motion_forward'
]:
	i: 195(t)
	o: 207()

nname: 195
n 195(0 < speed)[]:
	i: 183(), 193()
	o: 198(t), 206(f)

nname: 193
n 193(None)[speed
]:
	i: 169(f)
	o: 195()

nname: 183
n 183(None)[]:
	i: 169(t)
	o: 195()

nname: 169
n 169(0 < speed)[]:
	i: 160(), 168()
	o: 183(t), 193(f)

nname: 168
n 168(None)[]:
	i: 157(f)
	o: 169()

nname: 160
n 160(None)[return 'slow_motion_rewind'
]:
	i: 157(t)
	o: 169()

nname: 157
n 157(-1 <= speed)[]:
	i: 145(), 155()
	o: 160(t), 168(f)

nname: 155
n 155(None)[speed
]:
	i: 131(f)
	o: 157()

nname: 145
n 145(None)[]:
	i: 131(t)
	o: 157()

nname: 131
n 131(-1 <= speed)[]:
	i: 112(JA), 116(JA), 127(), 130()
	o: 145(t), 155(f)

nname: 130
n 130(None)[]:
	i: 58(f)
	o: 131()

nname: 116
n 116(None)[return 'play'
]:
	i: 70(except)
	o: 131(JA)

nname: 112
n 112(None)[]:
	i: 99(), 107()
	o: 131(JA)

nname: 107
n 107(None)[return 'next_track'
]:
	i: 74(f)
	o: 112()

nname: 99
n 99(None)[return 'previous_track'
]:
	i: 74(t)
	o: 112()

nname: 74
n 74(val < 0)[val = self._last_action['val']
]:
	i: 70(try)
	o: 99(t), 107(f)

nname: 70
n 70(None)[]:
	i: 58(t)
	o: 74(try), 116(except)

nname: 58
n 58(speed == 1)[]:
	i: 49(), 57()
	o: 70(t), 130(f)

nname: 57
n 57(None)[]:
	i: 18&36(f)
	o: 58()

nname: 49
n 49(None)[return 'pause'
]:
	i: 18&36(t)
	o: 58()

nname: 18&36
n 18&36(self._in_pause or speed == 0)[speed = self.speed
]:
	i: 9(), 17()
	o: 49(t), 57(f)

nname: 17
n 17(None)[]:
	i: 0(f)
	o: 18&36()

nname: 9
n 9(None)[return None
]:
	i: 0(t)
	o: 18&36()

nname: 0
n 0(self.is_menu)[]:
	i: 
	o: 9(t), 17(f)

nname: 287
n 287(None)[return 'stop'
]:
	i: 207()
	o: 

nname: 207
n 207(None)[if speed > 1:
	return forward_tricks_icons[self.eventhandler.forward_steps.index(speed)]
if speed < -1:
	return backward_tricks_icons[self.eventhandler.backward_steps.index(speed)]
]:
	i: 169()
	o: 287()

nname: 169
n 169(None)[if 0 < speed:
	pass
else:
	speed
if 0 < speed:
	return 'slow_motion_forward'
]:
	i: 131()
	o: 207()

nname: 131
n 131(None)[if -1 <= speed:
	pass
else:
	speed
if -1 <= speed:
	return 'slow_motion_rewind'
]:
	i: 116(JA), 127(), 70(), 58(f)
	o: 169()

nname: 116
n 116(None)[except:
	return 'play'
]:
	i: 70()
	o: 131(JA)

nname: 70
n 70(None)[try:
	val = self._last_action['val']
	if val < 0:
		return 'previous_track'
	else:
		return 'next_track'
]:
	i: 58(t)
	o: 131(), 116()

nname: 58
n 58(speed == 1)[]:
	i: 0()
	o: 70(t), 131(f)

nname: 0
n 0(None)[if self.is_menu:
	return None
speed = self.speed
if self._in_pause or speed == 0:
	return 'pause'
]:
	i: 
	o: 58()

nname: 207
n 207(None)[if speed > 1:
	return forward_tricks_icons[self.eventhandler.forward_steps.index(speed)]
if speed < -1:
	return backward_tricks_icons[self.eventhandler.backward_steps.index(speed)]
return 'stop'
]:
	i: 131()
	o: 

nname: 131
n 131(None)[if -1 <= speed:
	pass
else:
	speed
if -1 <= speed:
	return 'slow_motion_rewind'
if 0 < speed:
	pass
else:
	speed
if 0 < speed:
	return 'slow_motion_forward'
]:
	i: 116(JA), 127(), 70(), 0(f)
	o: 207()

nname: 116
n 116(None)[except:
	return 'play'
]:
	i: 70()
	o: 131(JA)

nname: 70
n 70(None)[try:
	val = self._last_action['val']
	if val < 0:
		return 'previous_track'
	else:
		return 'next_track'
]:
	i: 0(t)
	o: 131(), 116()

nname: 0
n 0(speed == 1)[if self.is_menu:
	return None
speed = self.speed
if self._in_pause or speed == 0:
	return 'pause'
]:
	i: 
	o: 70(t), 131(f)

nname: 131
n 131(None)[if -1 <= speed:
	pass
else:
	speed
if -1 <= speed:
	return 'slow_motion_rewind'
if 0 < speed:
	pass
else:
	speed
if 0 < speed:
	return 'slow_motion_forward'
if speed > 1:
	return forward_tricks_icons[self.eventhandler.forward_steps.index(speed)]
if speed < -1:
	return backward_tricks_icons[self.eventhandler.backward_steps.index(speed)]
return 'stop'
]:
	i: 116(JA), 127(), 70(), 0(f)
	o: 

nname: 116
n 116(None)[except:
	return 'play'
]:
	i: 70()
	o: 131(JA)

nname: 70
n 70(None)[try:
	val = self._last_action['val']
	if val < 0:
		return 'previous_track'
	else:
		return 'next_track'
]:
	i: 0(t)
	o: 131(), 116()

nname: 0
n 0(speed == 1)[if self.is_menu:
	return None
speed = self.speed
if self._in_pause or speed == 0:
	return 'pause'
]:
	i: 
	o: 70(t), 131(f)

self.nodes: {0: <unpyclib.structure.node instance at 0xb76cfc0c>, 131: <unpyclib.structure.node instance at 0xb76be28c>, 70: <unpyclib.structure.node instance at 0xb76cf64c>, 116: <unpyclib.structure.node instance at 0xb76c2bac>, 126: <unpyclib.structure.node instance at 0xb76c29ec>, 127: <unpyclib.structure.node instance at 0xb76c2d0c>}
nname: 6
n 6(None)[media = 'video'
_tv_aspect = 0
def __init__(self, type='dvdplayer'):
	self.eventhandler = DVDEventHandler(self)
	Player.__init__(self, type)
	self.wydvd = WydvdCatcher(self)
	self._in_pause = False
	self._uop_hide_task = Task(louie_send, 'on_uop_hide', self)
	self._uop_hide_task.delay = 3
	self.nb_ptt = 0
	self._getitems_keywords['speed'] = self._formatted_speed

def _formatted_speed(self):
	s = self.speed
	if 0 < s:
		pass
	else:
		s
	if 0 < s:
		return '%.1fx' % s
	if s in (0, 1):
		return ''
	return '%dx' % s

is_menu = property()
is_playing = property((lambda self: self.wydvd.domain == 'TITLE'))
def _activate_uop_display(self):
	if not self._uop_hide_task.running:
		louie_send('on_uop_show', self)
	self._uop_hide_task.start()

def tick_callback(self):
	try:
		if self._last_action['time'] + 1 < sched.ts:
			self._last_action = None

action_up = user_action()
action_down = user_action()
action_left = user_action()
action_right = user_action()
def action_select(self):
	if self.is_menu:
		self.wydvd.action_button('activate')
	else:
		self.toggle_pause()

toggle_pause = user_action()
def play(self, item, playlist=None, delay=0):
	Player.play(self, item, playlist)
	self._idle_timer = None
	_t = type(item)
	if _t == IsoDVDItem:
		self.wydvd.open(path=item['uri'])
	else:
		if _t == DVDItem:
			self.wydvd.open()
	self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
	if delay:
		delay['title'] = delay.pop('num')
		self.wydvd.time_play(**delay)
	else:
		self.wydvd.play()
	self._in_pause = False
	return None

def stop(self):
	self._idle_timer = None
	if self.is_playing and config.resume_dvd:
		self.selected.vfs_set_metas(playbackStatus=repr(self.wydvd.get_title_location()))
	else:
		self.selected.vfs_set_metas(playbackStatus='')
	self.wydvd.stop()
	self.wydvd.close()
	Player.stop(self)
	return None

_set_speed = user_action()
def _get_speed(self):
	if not(not self._in_pause and self.wydvd.get_speed()):
		pass
	return 0

speed = property(_get_speed, _set_speed)
def action_info(self):
	if self._idle_timer and self._idle_timer.running:
		self._idle_timer.stop()
		self._idle_timer = None
		louie_send('on_user_idle', self)
	else:
		user_action((lambda self: None))(self)
	return None

def _get_status(self):
	if self.is_menu:
		return None
	speed = self.speed
	if self._in_pause or speed == 0:
		return 'pause'

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76b3d0c>}
nname: 265
n 265(None)[__all__ = ['DVDPlayer']
def user_action(func):
	def exe(self, *args, **args):
		def _on_idle():
			actual_speed = self.speed
			if actual_speed and int(actual_speed * 10) != 10:
				self._idle_timer.stop()
				self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			else:
				louie_send('on_user_idle', self)
				self._idle_timer = None
			return None

		def _on_action():
			if self.is_menu:
				return None
			if self._idle_timer is None:
				self._idle_timer = Task(_on_idle)
				louie_send('on_user_event', self)
			else:
				self._idle_timer.stop()
			self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			return None

		ret = func(self, *args, **kw)
		if self.is_playing:
			_on_action()
		return ret

	return exe

class WydvdCatcher(object):
	actions_dict = dict()
	def __init__(self, player, *args, **args):
		self._wydvd = Wydvd()
		self._player = player
		WydvdCatcher.actions_dict['WYDVD_UOP_PROHIBITED'] = player._activate_uop_display

	def __getattr__(self, name):
		res = None
		try:
			res = getattr(self._wydvd, name)
			if not isinstance(res, (types.MethodType, types.FunctionType)):
				return res



class DVDPlayer(Player):
	media = 'video'
	_tv_aspect = 0
	def __init__(self, type='dvdplayer'):
		self.eventhandler = DVDEventHandler(self)
		Player.__init__(self, type)
		self.wydvd = WydvdCatcher(self)
		self._in_pause = False
		self._uop_hide_task = Task(louie_send, 'on_uop_hide', self)
		self._uop_hide_task.delay = 3
		self.nb_ptt = 0
		self._getitems_keywords['speed'] = self._formatted_speed

	def _formatted_speed(self):
		s = self.speed
		if 0 < s:
			pass
		else:
			s
		if 0 < s:
			return '%.1fx' % s
		if s in (0, 1):
			return ''
		return '%dx' % s

	is_menu = property()
	is_playing = property((lambda self: self.wydvd.domain == 'TITLE'))
	def _activate_uop_display(self):
		if not self._uop_hide_task.running:
			louie_send('on_uop_show', self)
		self._uop_hide_task.start()

	def tick_callback(self):
		try:
			if self._last_action['time'] + 1 < sched.ts:
				self._last_action = None

	action_up = user_action()
	action_down = user_action()
	action_left = user_action()
	action_right = user_action()
	def action_select(self):
		if self.is_menu:
			self.wydvd.action_button('activate')
		else:
			self.toggle_pause()

	toggle_pause = user_action()
	def play(self, item, playlist=None, delay=0):
		Player.play(self, item, playlist)
		self._idle_timer = None
		_t = type(item)
		if _t == IsoDVDItem:
			self.wydvd.open(path=item['uri'])
		else:
			if _t == DVDItem:
				self.wydvd.open()
		self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
		if delay:
			delay['title'] = delay.pop('num')
			self.wydvd.time_play(**delay)
		else:
			self.wydvd.play()
		self._in_pause = False
		return None

	def stop(self):
		self._idle_timer = None
		if self.is_playing and config.resume_dvd:
			self.selected.vfs_set_metas(playbackStatus=repr(self.wydvd.get_title_location()))
		else:
			self.selected.vfs_set_metas(playbackStatus='')
		self.wydvd.stop()
		self.wydvd.close()
		Player.stop(self)
		return None

	_set_speed = user_action()
	def _get_speed(self):
		if not(not self._in_pause and self.wydvd.get_speed()):
			pass
		return 0

	speed = property(_get_speed, _set_speed)
	def action_info(self):
		if self._idle_timer and self._idle_timer.running:
			self._idle_timer.stop()
			self._idle_timer = None
			louie_send('on_user_idle', self)
		else:
			user_action((lambda self: None))(self)
		return None

	def _get_status(self):
		if self.is_menu:
			return None
		speed = self.speed
		if self._in_pause or speed == 0:
			return 'pause'



from pygui.item.mediaitem import DVDItem, IsoDVDItem
]:
	i: 172(), 221(), 263(AE)
	o: 

nname: 263
n 263(None)[]:
	i: 211(f)
	o: 265(AE)

nname: 221
n 221(None)[from wydvd import Wydvd, WydvdException
log.info('Using DVD backend')
]:
	i: 211(t)
	o: 265()

nname: 211
n 211(<dummy_ex3> EXC_MATCH ImportError)[]:
	i: 0(except)
	o: 221(t), 263(f)

nname: 172
n 172(None)[from wyump import Wydvd, WydvdException
log.info('Using Blu-Ray backend')
]:
	i: 0(try)
	o: 265()

nname: 0
n 0(None)[from __future__ import absolute_import
from .core import Player
import types
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from peewee.notifier import sched, Task
import pygui.config as config
from pygui.eventmanager.players import DVDEventHandler
from . import forward_tricks_icons, backward_tricks_icons
log = GET_LOGGER(__name__)
]:
	i: 
	o: 172(try), 211(except)

nname: 211
n 211(None)[except ImportError:
	from wydvd import Wydvd, WydvdException
	log.info('Using DVD backend')
__all__ = ['DVDPlayer']
def user_action(func):
	def exe(self, *args, **args):
		def _on_idle():
			actual_speed = self.speed
			if actual_speed and int(actual_speed * 10) != 10:
				self._idle_timer.stop()
				self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			else:
				louie_send('on_user_idle', self)
				self._idle_timer = None
			return None

		def _on_action():
			if self.is_menu:
				return None
			if self._idle_timer is None:
				self._idle_timer = Task(_on_idle)
				louie_send('on_user_event', self)
			else:
				self._idle_timer.stop()
			self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			return None

		ret = func(self, *args, **kw)
		if self.is_playing:
			_on_action()
		return ret

	return exe

class WydvdCatcher(object):
	actions_dict = dict()
	def __init__(self, player, *args, **args):
		self._wydvd = Wydvd()
		self._player = player
		WydvdCatcher.actions_dict['WYDVD_UOP_PROHIBITED'] = player._activate_uop_display

	def __getattr__(self, name):
		res = None
		try:
			res = getattr(self._wydvd, name)
			if not isinstance(res, (types.MethodType, types.FunctionType)):
				return res



class DVDPlayer(Player):
	media = 'video'
	_tv_aspect = 0
	def __init__(self, type='dvdplayer'):
		self.eventhandler = DVDEventHandler(self)
		Player.__init__(self, type)
		self.wydvd = WydvdCatcher(self)
		self._in_pause = False
		self._uop_hide_task = Task(louie_send, 'on_uop_hide', self)
		self._uop_hide_task.delay = 3
		self.nb_ptt = 0
		self._getitems_keywords['speed'] = self._formatted_speed

	def _formatted_speed(self):
		s = self.speed
		if 0 < s:
			pass
		else:
			s
		if 0 < s:
			return '%.1fx' % s
		if s in (0, 1):
			return ''
		return '%dx' % s

	is_menu = property()
	is_playing = property((lambda self: self.wydvd.domain == 'TITLE'))
	def _activate_uop_display(self):
		if not self._uop_hide_task.running:
			louie_send('on_uop_show', self)
		self._uop_hide_task.start()

	def tick_callback(self):
		try:
			if self._last_action['time'] + 1 < sched.ts:
				self._last_action = None

	action_up = user_action()
	action_down = user_action()
	action_left = user_action()
	action_right = user_action()
	def action_select(self):
		if self.is_menu:
			self.wydvd.action_button('activate')
		else:
			self.toggle_pause()

	toggle_pause = user_action()
	def play(self, item, playlist=None, delay=0):
		Player.play(self, item, playlist)
		self._idle_timer = None
		_t = type(item)
		if _t == IsoDVDItem:
			self.wydvd.open(path=item['uri'])
		else:
			if _t == DVDItem:
				self.wydvd.open()
		self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
		if delay:
			delay['title'] = delay.pop('num')
			self.wydvd.time_play(**delay)
		else:
			self.wydvd.play()
		self._in_pause = False
		return None

	def stop(self):
		self._idle_timer = None
		if self.is_playing and config.resume_dvd:
			self.selected.vfs_set_metas(playbackStatus=repr(self.wydvd.get_title_location()))
		else:
			self.selected.vfs_set_metas(playbackStatus='')
		self.wydvd.stop()
		self.wydvd.close()
		Player.stop(self)
		return None

	_set_speed = user_action()
	def _get_speed(self):
		if not(not self._in_pause and self.wydvd.get_speed()):
			pass
		return 0

	speed = property(_get_speed, _set_speed)
	def action_info(self):
		if self._idle_timer and self._idle_timer.running:
			self._idle_timer.stop()
			self._idle_timer = None
			louie_send('on_user_idle', self)
		else:
			user_action((lambda self: None))(self)
		return None

	def _get_status(self):
		if self.is_menu:
			return None
		speed = self.speed
		if self._in_pause or speed == 0:
			return 'pause'



from pygui.item.mediaitem import DVDItem, IsoDVDItem
]:
	i: 0()
	o: 

nname: 0
n 0(None)[from __future__ import absolute_import
from .core import Player
import types
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from peewee.notifier import sched, Task
import pygui.config as config
from pygui.eventmanager.players import DVDEventHandler
from . import forward_tricks_icons, backward_tricks_icons
log = GET_LOGGER(__name__)
try:
	from wyump import Wydvd, WydvdException
	log.info('Using Blu-Ray backend')
]:
	i: 
	o: 211()

nname: 0
n 0(None)[from __future__ import absolute_import
from .core import Player
import types
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from peewee.notifier import sched, Task
import pygui.config as config
from pygui.eventmanager.players import DVDEventHandler
from . import forward_tricks_icons, backward_tricks_icons
log = GET_LOGGER(__name__)
try:
	from wyump import Wydvd, WydvdException
	log.info('Using Blu-Ray backend')
except ImportError:
	from wydvd import Wydvd, WydvdException
	log.info('Using DVD backend')
__all__ = ['DVDPlayer']
def user_action(func):
	def exe(self, *args, **args):
		def _on_idle():
			actual_speed = self.speed
			if actual_speed and int(actual_speed * 10) != 10:
				self._idle_timer.stop()
				self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			else:
				louie_send('on_user_idle', self)
				self._idle_timer = None
			return None

		def _on_action():
			if self.is_menu:
				return None
			if self._idle_timer is None:
				self._idle_timer = Task(_on_idle)
				louie_send('on_user_event', self)
			else:
				self._idle_timer.stop()
			self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			return None

		ret = func(self, *args, **kw)
		if self.is_playing:
			_on_action()
		return ret

	return exe

class WydvdCatcher(object):
	actions_dict = dict()
	def __init__(self, player, *args, **args):
		self._wydvd = Wydvd()
		self._player = player
		WydvdCatcher.actions_dict['WYDVD_UOP_PROHIBITED'] = player._activate_uop_display

	def __getattr__(self, name):
		res = None
		try:
			res = getattr(self._wydvd, name)
			if not isinstance(res, (types.MethodType, types.FunctionType)):
				return res



class DVDPlayer(Player):
	media = 'video'
	_tv_aspect = 0
	def __init__(self, type='dvdplayer'):
		self.eventhandler = DVDEventHandler(self)
		Player.__init__(self, type)
		self.wydvd = WydvdCatcher(self)
		self._in_pause = False
		self._uop_hide_task = Task(louie_send, 'on_uop_hide', self)
		self._uop_hide_task.delay = 3
		self.nb_ptt = 0
		self._getitems_keywords['speed'] = self._formatted_speed

	def _formatted_speed(self):
		s = self.speed
		if 0 < s:
			pass
		else:
			s
		if 0 < s:
			return '%.1fx' % s
		if s in (0, 1):
			return ''
		return '%dx' % s

	is_menu = property()
	is_playing = property((lambda self: self.wydvd.domain == 'TITLE'))
	def _activate_uop_display(self):
		if not self._uop_hide_task.running:
			louie_send('on_uop_show', self)
		self._uop_hide_task.start()

	def tick_callback(self):
		try:
			if self._last_action['time'] + 1 < sched.ts:
				self._last_action = None

	action_up = user_action()
	action_down = user_action()
	action_left = user_action()
	action_right = user_action()
	def action_select(self):
		if self.is_menu:
			self.wydvd.action_button('activate')
		else:
			self.toggle_pause()

	toggle_pause = user_action()
	def play(self, item, playlist=None, delay=0):
		Player.play(self, item, playlist)
		self._idle_timer = None
		_t = type(item)
		if _t == IsoDVDItem:
			self.wydvd.open(path=item['uri'])
		else:
			if _t == DVDItem:
				self.wydvd.open()
		self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
		if delay:
			delay['title'] = delay.pop('num')
			self.wydvd.time_play(**delay)
		else:
			self.wydvd.play()
		self._in_pause = False
		return None

	def stop(self):
		self._idle_timer = None
		if self.is_playing and config.resume_dvd:
			self.selected.vfs_set_metas(playbackStatus=repr(self.wydvd.get_title_location()))
		else:
			self.selected.vfs_set_metas(playbackStatus='')
		self.wydvd.stop()
		self.wydvd.close()
		Player.stop(self)
		return None

	_set_speed = user_action()
	def _get_speed(self):
		if not(not self._in_pause and self.wydvd.get_speed()):
			pass
		return 0

	speed = property(_get_speed, _set_speed)
	def action_info(self):
		if self._idle_timer and self._idle_timer.running:
			self._idle_timer.stop()
			self._idle_timer = None
			louie_send('on_user_idle', self)
		else:
			user_action((lambda self: None))(self)
		return None

	def _get_status(self):
		if self.is_menu:
			return None
		speed = self.speed
		if self._in_pause or speed == 0:
			return 'pause'



from pygui.item.mediaitem import DVDItem, IsoDVDItem
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76aaaec>}
from __future__ import absolute_import
from .core import Player
import types
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send as louie_send
from peewee.notifier import sched, Task
import pygui.config as config
from pygui.eventmanager.players import DVDEventHandler
from . import forward_tricks_icons, backward_tricks_icons
log = GET_LOGGER(__name__)
try:
	from wyump import Wydvd, WydvdException
	log.info('Using Blu-Ray backend')
except ImportError:
	from wydvd import Wydvd, WydvdException
	log.info('Using DVD backend')
__all__ = ['DVDPlayer']
def user_action(func):
	def exe(self, *args, **args):
		def _on_idle():
			actual_speed = self.speed
			if actual_speed and int(actual_speed * 10) != 10:
				self._idle_timer.stop()
				self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			else:
				louie_send('on_user_idle', self)
				self._idle_timer = None
			return None

		def _on_action():
			if self.is_menu:
				return None
			if self._idle_timer is None:
				self._idle_timer = Task(_on_idle)
				louie_send('on_user_event', self)
			else:
				self._idle_timer.stop()
			self._idle_timer.start(config.HMI_VIDEO['idle_threshold'])
			return None

		ret = func(self, *args, **kw)
		if self.is_playing:
			_on_action()
		return ret

	return exe

class WydvdCatcher(object):
	actions_dict = dict()
	def __init__(self, player, *args, **args):
		self._wydvd = Wydvd()
		self._player = player
		WydvdCatcher.actions_dict['WYDVD_UOP_PROHIBITED'] = player._activate_uop_display

	def __getattr__(self, name):
		res = None
		try:
			res = getattr(self._wydvd, name)
			if not isinstance(res, (types.MethodType, types.FunctionType)):
				return res



class DVDPlayer(Player):
	media = 'video'
	_tv_aspect = 0
	def __init__(self, type='dvdplayer'):
		self.eventhandler = DVDEventHandler(self)
		Player.__init__(self, type)
		self.wydvd = WydvdCatcher(self)
		self._in_pause = False
		self._uop_hide_task = Task(louie_send, 'on_uop_hide', self)
		self._uop_hide_task.delay = 3
		self.nb_ptt = 0
		self._getitems_keywords['speed'] = self._formatted_speed

	def _formatted_speed(self):
		s = self.speed
		if 0 < s:
			pass
		else:
			s
		if 0 < s:
			return '%.1fx' % s
		if s in (0, 1):
			return ''
		return '%dx' % s

	is_menu = property()
	is_playing = property((lambda self: self.wydvd.domain == 'TITLE'))
	def _activate_uop_display(self):
		if not self._uop_hide_task.running:
			louie_send('on_uop_show', self)
		self._uop_hide_task.start()

	def tick_callback(self):
		try:
			if self._last_action['time'] + 1 < sched.ts:
				self._last_action = None

	action_up = user_action()
	action_down = user_action()
	action_left = user_action()
	action_right = user_action()
	def action_select(self):
		if self.is_menu:
			self.wydvd.action_button('activate')
		else:
			self.toggle_pause()

	toggle_pause = user_action()
	def play(self, item, playlist=None, delay=0):
		Player.play(self, item, playlist)
		self._idle_timer = None
		_t = type(item)
		if _t == IsoDVDItem:
			self.wydvd.open(path=item['uri'])
		else:
			if _t == DVDItem:
				self.wydvd.open()
		self.wydvd.set_surround(config.user_config['connections']['spdif_surround'])
		if delay:
			delay['title'] = delay.pop('num')
			self.wydvd.time_play(**delay)
		else:
			self.wydvd.play()
		self._in_pause = False
		return None

	def stop(self):
		self._idle_timer = None
		if self.is_playing and config.resume_dvd:
			self.selected.vfs_set_metas(playbackStatus=repr(self.wydvd.get_title_location()))
		else:
			self.selected.vfs_set_metas(playbackStatus='')
		self.wydvd.stop()
		self.wydvd.close()
		Player.stop(self)
		return None

	_set_speed = user_action()
	def _get_speed(self):
		if not(not self._in_pause and self.wydvd.get_speed()):
			pass
		return 0

	speed = property(_get_speed, _set_speed)
	def action_info(self):
		if self._idle_timer and self._idle_timer.running:
			self._idle_timer.stop()
			self._idle_timer = None
			louie_send('on_user_idle', self)
		else:
			user_action((lambda self: None))(self)
		return None

	def _get_status(self):
		if self.is_menu:
			return None
		speed = self.speed
		if self._in_pause or speed == 0:
			return 'pause'



from pygui.item.mediaitem import DVDItem, IsoDVDItem
